package com.gxa.sso.routing;

/**
 * Created by zxd on 2020/12/21
 **/
public class DataSourceHolder {

    private static final ThreadLocal<String> tl=new ThreadLocal<String>();

    /**
     * 往当前线程设置数据库的标记
     * @param key
     */
    public static void setDataSource(String key){
        tl.set(key);
    }

    /**
     * 获取前线程数据库的标记
     */
    public static String getDataSource(){

        return tl.get();
    }

}
